1. Field of the Invention
The present invention generally relates to computer systems, and in particular, to a method and apparatus for collecting hardware performance counter data.
2. Description of the Related Art
Hardware and software developers use information collected by a performance-monitoring tool to better understand how hardware components within a computer system operate with the operating system kernel and application programs. For example, hardware component designers may use the performance-monitoring tool to monitor a hardware component""s performance so that the data collected thereby may be used to drive optimization of the component""s design. Similarly, software developers may use the information provided by the performance-monitoring tool to develop software code that utilizes various components within a computer system more efficiently.
Typically, performance counters are used to monitor the performance of a computer system. The performance counters are implemented as registers in hardware components and variables in software codes and are used to count the number of occurrences of a particular event, such as for example, to count the number of cache misses. By monitoring the performance counters, hardware and software developers can better understand the dynamics of the computer system to allow development of hardware components and software codes that utilizes the computer system platform more efficiently.
Currently, there is no effective way in which the performance counters residing in hardware components are monitored. For example, the preexisting performance-monitoring tools do not allow a user to selectively choose which hardware performance counters are to be monitored. In the preexisting performance-monitoring tools, all performance counters within a performance object are collected during the performance-monitoring tool""s periodic call to collect data. Consequently, if a performance object contains a number of performance counters (e.g., ten performance counters), all performance counters within the performance object must be monitored even if information with regard to only one performance counter is needed. Moreover, the preexisting performance-monitoring tools do not allow a user to selectively customize the collection of performance counter data.
Therefore, there is a need to provide a performance-monitoring tool, which allows a user to select performance counters to be monitored and to customize their collection.